"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _vue = require("vue");

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

var _vueTypes = _interopRequireDefault(require("../_util/vue-types"));

var _useConfigInject2 = _interopRequireDefault(require("../_util/hooks/useConfigInject"));

var _default = (0, _vue.defineComponent)({
  name: 'SInputGroup',
  props: {
    prefixCls: _vueTypes.default.string,
    size: {
      type: String
    },
    compact: _vueTypes.default.looseBool,
    onMouseenter: {
      type: Function
    },
    onMouseleave: {
      type: Function
    },
    onFocus: {
      type: Function
    },
    onBlur: {
      type: Function
    }
  },
  setup: function setup(props, _ref) {
    var slots = _ref.slots;

    var _useConfigInject = (0, _useConfigInject2.default)('input-group', props),
        prefixCls = _useConfigInject.prefixCls,
        direction = _useConfigInject.direction;

    var cls = (0, _vue.computed)(function () {
      var _ref2;

      var pre = prefixCls.value;
      return _ref2 = {}, (0, _defineProperty2.default)(_ref2, "".concat(pre), true), (0, _defineProperty2.default)(_ref2, "".concat(pre, "-lg"), props.size === 'large'), (0, _defineProperty2.default)(_ref2, "".concat(pre, "-sm"), props.size === 'small'), (0, _defineProperty2.default)(_ref2, "".concat(pre, "-compact"), props.compact), (0, _defineProperty2.default)(_ref2, "".concat(pre, "-rtl"), direction.value === 'rtl'), _ref2;
    });
    return function () {
      var _a;

      return (0, _vue.createVNode)("span", {
        "class": cls.value,
        "onMouseenter": props.onMouseEnter,
        "onMouseleave": props.onMouseLeave,
        "onFocus": props.onFocus,
        "onBlur": props.onBlur
      }, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]);
    };
  }
});

exports.default = _default;